@extends('admin.layout.layout', ['row' => @$page])

@section('contain')


    <div class="portlet">
        <div class="portlet-title">
            <div class="caption">
                <x-portlet-breadcrumb :page="$page"></x-portlet-breadcrumb>
            </div>
            <div class="actions">
            </div>
        </div>

        <div class="filter-wrapper">
            <form action="/{{ request()->path() }}/" class="form-inline filter-form">
                <div class=" input-group mb-3 custom-control-inline">
                    <input type="text" class="form-control s-input" name="value" value="{{ request()->input('value') }}" placeholder="{{ ts('LS1') }}">
                </div>
                <x-flatpickr-date-range></x-flatpickr-date-range>
                <div class="mb-3">
                    <button class="btn btn-primary">{{ ts('SEARCH') }}</button>
                    <a href="/{{ request()->path() }}/" class="btn btn-warning">{{ ts('RESET') }}</a>
                </div>

            </form>
        </div>

        <div>
            <table class="table table-s2">
                <thead>
                <tr class="text-nowrap">
                    <th class="text-nowrap">{{ ts('sequence') }}</th>
                    <th>{{ ts('ipaddress') }}</th>
                    <th>{{ ts('USERID') }}</th>
                    <th>{{ ts('USERNAME') }}</th>
                    <th class="text-nowrap">{{ ts('COMPANYNAME') }}</th>
                    <th>{{ ts('TABLENAME') }}</th>
                    <th>{{ ts('OPERATIONS') }}</th>
                    <th>{{ ts('SQLQUERY') }}</th>
                    <th>{{ ts('createdat') }}</th>
                </tr>
                </thead>
                <tbody>
                @foreach($data as $k => $v)
                    <tr class="item-list">
                        <td class="text-center">
                            <div class="truncated-3">{{ @$data->firstItem()+$k }}</div>
                        </td>
                        <td class="text-nowrap">
                            {{ @$v->ip }}
                        </td>
                        <td>
                            {{ @$v->user_id }}
                        </td>
                        <td>
                            {{ @$v->user_name }}
                        </td>
                        <td class="text-nowrap">
                            {{ @$v->abbr }}
                        </td>
                        <td class="text-nowrap">
                            {{ @$v->table_name }}
                        </td>
                        <td>
                            {{ @$v->operation }}
                        </td>
                        <td>
                            <div class="truncated-3">{{ @$v->query }}</div>
                        </td>
                        <td class="text-nowrap">
                            {{ fdate2(@$v->created_at) }}
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>

            <div class="row my-3">
                <div class="col">
                    {{ $data->appends(request()->input())->links() }}
                </div>
            </div>
        </div>

    </div>


@endsection

@section('script')
    <script>
        $(document).ready(function () {
            $('.table.bt-table').bootstrapTable({}).removeClass('d-none')
        })
    </script>
@endsection